{{ $slice := .slice }}
{{ $divs := newScratch }}

{{ range $slice }}
    {{ $rand  := math.Rand | mul 1e2 | math.Round }}
    {{ $count := $rand | cast.ToString }}
    {{ $span_name  := partial "functions/area_element_style/base/span" (dict "innerHTML" .) }}
    {{ $span_count := partial "functions/area_element_style/base/span" (dict "innerHTML" $count "class" "ms-1 discourse-tag-count badge rounded-pill bg-secondary bg-opacity-25 small") }}

    {{ $inner := printf "%s%s" $span_name $span_count }}

    {{ $button := partial "functions/area_element_style/base/button" (dict "innerHTML" $inner "class" "btn btn-sm bg-secondary bg-opacity-10 tags-tag-name" "type" "button") }}

    {{ $divs.Add "html" $button }}
{{ end }}

{{ return ($divs.Get "html" | safeHTML) }}